package com.situ.firmadmin.controller;

import com.situ.firmadmin.service.INoticeService;
import com.situ.firmadmin.service.IReimService;
import com.situ.firmadmin.service.IUserService;
import com.situ.firmadmin.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/chart")
public class ChartController {
   
    @Autowired
    private IUserService userService;
    @Autowired
    private IReimService reimService;
    @Autowired
    private INoticeService noticeService;
    
    @GetMapping("/selectTotalCount")
    public Result selectTotalCount(){
        Map<String,Object> map=new HashMap<>();
        Long userCount=userService.selectCount();
        Long reimCount=reimService.selectAdopt();
        Long amountCount=reimService.selectAllAmount();
        Long noticeCount=noticeService.selectCount();
        map.put("userCount",userCount);
        map.put("reimCount",reimCount);
        map.put("amountCount",amountCount);
        map.put("noticeCount",noticeCount);
        return Result.ok(map);
    }
    
}
